home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / bindtable.z / bindtable
Text File  |  1998-10-30  |  13KB  |  199 lines

  1.  
  2.  
  3.  
  4. TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk))))                          TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tk_CreateBindingTable, Tk_DeleteBindingTable, Tk_CreateBinding,
  10.      Tk_DeleteBinding, Tk_GetBinding, Tk_GetAllBindings, Tk_DeleteAllBindings,
  11.      Tk_BindEvent - invoke scripts in response to X events
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
  15.  
  16.      Tk_BindingTable
  17.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((_i_n_t_e_r_p))))
  18.  
  19.      TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((_b_i_n_d_i_n_g_T_a_b_l_e))))
  20.  
  21.      unsigned long
  22.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnngggg((((_i_n_t_e_r_p, _b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t, _e_v_e_n_t_S_t_r_i_n_g, _s_c_r_i_p_t, _a_p_p_e_n_d))))
  23.  
  24.      int
  25.      TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnngggg((((_i_n_t_e_r_p, _b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t, _e_v_e_n_t_S_t_r_i_n_g))))
  26.  
  27.      char *
  28.      TTTTkkkk____GGGGeeeettttBBBBiiiinnnnddddiiiinnnngggg((((_i_n_t_e_r_p, _b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t, _e_v_e_n_t_S_t_r_i_n_g))))
  29.  
  30.      TTTTkkkk____GGGGeeeettttAAAAllllllllBBBBiiiinnnnddddiiiinnnnggggssss((((_i_n_t_e_r_p, _b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t))))
  31.  
  32.      TTTTkkkk____DDDDeeeelllleeeetttteeeeAAAAllllllllBBBBiiiinnnnddddiiiinnnnggggssss((((_b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t))))
  33.  
  34.      TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt((((_b_i_n_d_i_n_g_T_a_b_l_e, _e_v_e_n_t_P_t_r, _t_k_w_i_n, _n_u_m_O_b_j_e_c_t_s, _o_b_j_e_c_t_P_t_r))))
  35.  
  36. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  37.      Tcl_Interp        *_i_n_t_e_r_p        (in)      Interpreter to use when
  38.                                                 invoking bindings in binding
  39.                                                 table.  Also used for
  40.                                                 returning results and errors
  41.                                                 from binding procedures.
  42.  
  43.      Tk_BindingTable   _b_i_n_d_i_n_g_T_a_b_l_e   (in)      Token for binding table;  must
  44.                                                 have been returned by some
  45.                                                 previous call to
  46.                                                 TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee.
  47.  
  48.      ClientData        _o_b_j_e_c_t         (in)      Identifies object with which
  49.                                                 binding is associated.
  50.  
  51.      char              *_e_v_e_n_t_S_t_r_i_n_g   (in)      String describing event
  52.                                                 sequence.
  53.  
  54.      char              *_s_c_r_i_p_t        (in)      Tcl script to invoke when
  55.                                                 binding triggers.
  56.  
  57.      int               _a_p_p_e_n_d         (in)      Non-zero means append _s_c_r_i_p_t
  58.                                                 to existing script for
  59.                                                 binding, if any; zero means
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk))))                          TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.                                                 replace existing script with
  75.                                                 new one.
  76.  
  77.      XEvent            *_e_v_e_n_t_P_t_r      (in)      X event to match against
  78.                                                 bindings in _b_i_n_d_i_n_g_T_a_b_l_e.
  79.  
  80.      Tk_Window         _t_k_w_i_n          (in)      Identifier for any window on
  81.                                                 the display where the event
  82.                                                 occurred.  Used to find
  83.                                                 display-related information
  84.                                                 such as key maps.
  85.  
  86.      int               _n_u_m_O_b_j_e_c_t_s     (in)      Number of object identifiers
  87.                                                 pointed to by _o_b_j_e_c_t_P_t_r.
  88.  
  89.      ClientData        *_o_b_j_e_c_t_P_t_r     (in)      Points to an array of object
  90.                                                 identifiers:  bindings will be
  91.                                                 considered for each of these
  92.                                                 objects in order from first to
  93.                                                 last.
  94.  
  95.  
  96. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  97.      These procedures provide a general-purpose mechanism for creating and
  98.      invoking bindings.  Bindings are organized in terms of _b_i_n_d_i_n_g _t_a_b_l_e_s.  A
  99.      binding table consists of a collection of bindings plus a history of
  100.      recent events.  Within a binding table, bindings are associated with
  101.      _o_b_j_e_c_t_s.  The meaning of an object is defined by clients of the binding
  102.      package.  For example, Tk keeps uses one binding table to hold all of the
  103.      bindings created by the bbbbiiiinnnndddd command.  For this table, objects are
  104.      pointers to strings such as window names, class names, or other binding
  105.      tags such as aaaallllllll.  Tk also keeps a separate binding table for each canvas
  106.      widget, which manages bindings created by the canvas's bbbbiiiinnnndddd widget
  107.      command;  within this table, an object is either a pointer to the
  108.      internal structure for a canvas item or a Tk_Uid identifying a tag.
  109.  
  110.      The procedure TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee creates a new binding table and
  111.      associates _i_n_t_e_r_p with it (when bindings in the table are invoked, the
  112.      scripts will be evaluated in _i_n_t_e_r_p).  TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee returns a
  113.      token for the table, which must be used in calls to other procedures such
  114.      as TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnngggg or TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt.
  115.  
  116.      TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee frees all of the state associated with a binding
  117.      table.  Once it returns the caller should not use the _b_i_n_d_i_n_g_T_a_b_l_e token
  118.      again.
  119.  
  120.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnngggg adds a new binding to an existing table.  The _o_b_j_e_c_t
  121.      argument identifies the object with which the binding is to be
  122.      associated, and it may be any one-word value.  Typically it is a pointer
  123.      to a string or data structure.  The _e_v_e_n_t_S_t_r_i_n_g argument identifies the
  124.      event or sequence of events for the binding;  see the documentation for
  125.      the bbbbiiiinnnndddd command for a description of its format.  _s_c_r_i_p_t is the Tcl
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk))))                          TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.      script to be evaluated when the binding triggers.  _a_p_p_e_n_d indicates what
  141.      to do if there already exists a binding for _o_b_j_e_c_t and _e_v_e_n_t_S_t_r_i_n_g:  if
  142.      _a_p_p_e_n_d is zero then _s_c_r_i_p_t replaces the old script;  if _a_p_p_e_n_d is non-
  143.      zero then the new script is appended to the old one.  TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnngggg
  144.      returns an X event mask for all the events associated with the bindings.
  145.      This information may be useful to invoke XXXXSSSSeeeelllleeeeccccttttIIIInnnnppppuuuutttt to select relevant
  146.      events, or to disallow the use of certain events in bindings.  If an
  147.      error occurred while creating the binding (e.g., _e_v_e_n_t_S_t_r_i_n_g refers to a
  148.      non-existent event), then 0 is returned and an error message is left in
  149.      _i_n_t_e_r_p->_r_e_s_u_l_t.
  150.  
  151.      TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnngggg removes from _b_i_n_d_i_n_g_T_a_b_l_e the binding given by _o_b_j_e_c_t
  152.      and _e_v_e_n_t_S_t_r_i_n_g, if such a binding exists.  TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnngggg always
  153.      returns TCL_OK.  In some cases it may reset _i_n_t_e_r_p->_r_e_s_u_l_t to the default
  154.      empty value.
  155.  
  156.      TTTTkkkk____GGGGeeeettttBBBBiiiinnnnddddiiiinnnngggg returns a pointer to the script associated with _e_v_e_n_t_S_t_r_i_n_g
  157.      and _o_b_j_e_c_t in _b_i_n_d_i_n_g_T_a_b_l_e.  If no such binding exists then NULL is
  158.      returned and an error message is left in _i_n_t_e_r_p->_r_e_s_u_l_t.
  159.  
  160.      TTTTkkkk____GGGGeeeettttAAAAllllllllBBBBiiiinnnnddddiiiinnnnggggssss returns in _i_n_t_e_r_p->_r_e_s_u_l_t a list of all the event
  161.      strings for which there are bindings in _b_i_n_d_i_n_g_T_a_b_l_e associated with
  162.      _o_b_j_e_c_t.  If there are no bindings for _o_b_j_e_c_t then an empty string is
  163.      returned in _i_n_t_e_r_p->_r_e_s_u_l_t.
  164.  
  165.      TTTTkkkk____DDDDeeeelllleeeetttteeeeAAAAllllllllBBBBiiiinnnnddddiiiinnnnggggssss deletes all of the bindings in _b_i_n_d_i_n_g_T_a_b_l_e that are
  166.      associated with _o_b_j_e_c_t.
  167.  
  168.      TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt is called to process an event.  It makes a copy of the event
  169.      in an internal history list associated with the binding table, then it
  170.      checks for bindings that match the event.  TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt processes each of
  171.      the objects pointed to by _o_b_j_e_c_t_P_t_r in turn.  For each object, it finds
  172.      all the bindings that match the current event history, selects the most
  173.      specific binding using the priority mechanism described in the
  174.      documentation for bbbbiiiinnnndddd, and invokes the script for that binding.  If
  175.      there are no matching bindings for a particular object, then the object
  176.      is skipped.  TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt continues through all of the objects, handling
  177.      exceptions such as errors, bbbbrrrreeeeaaaakkkk, and ccccoooonnnnttttiiiinnnnuuuueeee as described in the
  178.      documentation for bbbbiiiinnnndddd.
  179.  
  180.  
  181. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  182.      binding, event, object, script
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.